$(function() {
	// 页面数据初始化
	orderId = sessionStorage['orderId'];
	getOrder();
	$("#orderDetailGrid").mobileGrid({orderId:orderId});
})
function name(cell,data){
	var html=''+data['product.name']+'';
	cell.html(html);
}
function price(cell,data){
	var html=''+data['product.price']+'';
	cell.html(html);
}
/*
 * 页面初始化
 */
function getOrder(){
	
	Newtouch.Ajax.sendParams({"orderId":orderId}, localStorage['APP_AJAX_PATH']+"/drinkingBar/view/orderDetailSearch.jsp.getOrder", function(data) {
		
		showData(data);
		
	}, function(err) {
		alert("网络错误：[" + err + "]");
		
	});
	
}

/*
 * 页面数据显示
 */
function showData(data){
	
	$("#orderNumber").html(data.orderNumber);
	$("#state").html(data.state_name);
	if(data.state=='1'){
		$("#state").css('color','red');
	}else if(data.state=='2'){
		$("#state").css('color','green');
	}else{
		$("#state").css('color','blue');
	}
	$("#address").html(data['address.city_name']+data['address.area_name']+
			data['address.street_name']+data['address.detail']+'</br>'+
			data['address.deliveryPersonNm'] +"</br>"+
			data['address.deliveryMobile']);
	$("#comment").html(data.comment);
	$("#amount").html(data.amount);
}

function calculate(cell,data){
	var html="";
	var price = data['product.price'];
	var quantity = data.quantity;
	html = price*quantity;
	cell.html(html);
}

